A viewport is a 'window' through which the player sees the current room.
Properties
Camera
Gets/sets the camera to be displayed in this viewport.
Height
Gets/sets the viewport's height in screen coordinates.
Visible
Gets/sets whether the viewport is enabled and drawn on screen.
Width
Gets/sets the viewport's width in screen coordinates.
X
Gets/sets the X position on the screen where this viewport is located.
Y
Gets/sets the Y position on the screen where this viewport is located.
ZOrder
Gets/sets the viewport's z-order relative to other viewports.
Methods
Create
Creates a new viewport.
Delete
Removes an existing viewport.
GetAtScreenXY
static Viewport GetAtScreenXY(int x, int y)
Finds if there's any viewport at the specified screen coordinates and returns the topmost one.
RoomToScreenPoint
Point RoomToScreenPoint(int roomx, int roomy, bool clipViewport)
Returns the point on screen corresponding to the given room coordinates if seen through this viewport.
ScreenToRoomPoint
Point ScreenToRoomPoint(int scrx, int scry, bool clipViewport)
Returns the point in room corresponding to the given screen coordinates if seen through this viewport.
SetPosition
void SetPosition(int x, int y, int width, int height)
Changes viewport's position on the screen.